<template>
    <fieldset>
        <legend>子组件</legend>
    </fieldset>
</template>
<script>
    // 父组件的beforeCreate
    // 父组件的created
    // 父组件的beforeMount
    // 子组件的beforCreate
    // 子组件的created
    // 子组件的beforeMount
    // 子组件的Mounted
    // 父组件的mounted



    //组件卸载的时候执行顺序
    // 父组件的beforeDestroy
    // 子组件的beforeDestroy
    // 子组件的destroyed
    // 父组件的destroyed
    export default {
        beforeCreate() {
            console.log('子组件的beforCreate')
        },
        created() {
            console.log('子组件的created')
        },
        beforeMount() {
            console.log('子组件的beforeMount')
        },
        mounted() {
            console.log('子组件的Mounted')
            this.timer = setInterval(() => {
                console.log('定时器在行')
            }, 1000)
        },
        beforeDestroy() {
            console.log('子组件的beforeDestroy')
            clearInterval(this.timer)
        },
        destroyed() {
            console.log('子组件的destroyed')
        }
    }
</script>